<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>paySuccess</title>
    <link rel="stylesheet" type="text/css" href="css/index.css"/>
    <script src="lib/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="lib/vue.js"></script>
    <script src="app/index.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="paySuccessHeader">
    <a href="index.html">返回</a>
</div>
<p class="paySuccess">支付成功！！！</p>
<a href="index.html" class="toIndex"><span id="sec">3</span>秒之后立即跳转....</a>
</body>
</html>
<script>
    var commonUrl = 'http://172.30.31.254:8080/youhuishop/';
    var sid = window.localStorage.getItem('sid');
    var sec = $('#sec').html();
    $.ajax({
        url:commonUrl+'api/shop/paySuccess',
        type: 'POST',
        dataType: 'json',
        data: {
            sid:sid
        },
        success:function (data) {
            console.log(data);
            $('.paySuccess').html(data.info);
        }
    })
    setTimeout(function () {
        window.location.href = 'index.html'
    },3000)
    setInterval(function () {
        sec--;
        $('#sec').html(sec);
    },1000)
</script>